<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/area.css">
</@override>
<@override name="body">

	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					发短信
			    </div>
			    <div class="panel-body">
    				<form id="submit_form" action="${ctx}/sms/sms/sendpost" class="form-horizontal" method="post">
		               	<div class="form-group">
		                    <label class="col-sm-3 control-label">电话：</label>
		                    <div class="col-sm-3">
		                    	<input class="form-control" id="phone" name="phone" />
		                    </div>
		                </div>
		               	
		               	<div class="form-group">
		                    <label class="col-sm-3 control-label">内容：</label>
		                    <div class="col-sm-3">
		                    	<textarea class="form-control" id="content" name="content" required></textarea>
		                    </div>
		                </div>
    					
		                <div class="form-group" style="margin-left:10px;">
			                <label class="col-sm-3 control-label"></label>
			                <input id="submit_button" type="submit" class="btn btn-primary" value="发送">
			            </div>
					</form>
        		</div>
			</div>
		</div>
	</div>

</@override>
<@override name="footer">

<script type="text/javascript">
	$("#submit_form").submit(function(){
		var thisform=$(this);
		$("#submit_button").attr("disabled",true);
		$("#submit_button").val("发送中...")
		$.post(thisform.attr("action"),{'phone':$("#phone").val(),'content':$("#content").val()},function(result){
			if(result.success){
				$.scojs_message("发送成功", $.scojs_message.TYPE_OK);
			}
			else{
				$.scojs_message(result.message, $.scojs_message.TYPE_ERROR);
			}
			$("#submit_button").attr("disabled",false);
			$("#submit_button").val("发送")
		});
		return false;
	});
</script>
</@override>
<@extends name="../layout.ftl"/>